// Copyright (C) 2012 Volkov Zachar
// This file is part of the "zAxis Game Engine".
// For conditions of distribution and use, see copyright notice zx_Common.hpp

#include "zx_FileSystem.hpp"

namespace zx {

//----------------------------------------------------------------------------//
//----------------------------------------------------------------------------//
DataStream::DataStream( void ) : m_size( 0 ), m_access( 0 ), m_mutex( new Mutex )
{
}
//----------------------------------------------------------------------------//
DataStream::~DataStream( void )
{
}
//----------------------------------------------------------------------------//
String DataStream::ReadLine( void )
{
 return "";
}
//----------------------------------------------------------------------------//
String DataStream::ReadString( int _length )
{
     if( _length < 0 )
     {
          _length = m_size;
     }
     
     if( !_length )
     {
          return "";
     }

     char* _buff = new char[ _length + 1 ];
     uint _readed = Read( _buff, _length );
     _buff[ _readed ] = 0;
     String _str = _buff;
     delete [] _buff;

     return _str;
}
//----------------------------------------------------------------------------//
uint DataStream::SkipLine( void )
{
 return 0;
}
//----------------------------------------------------------------------------//
uint DataStream::SkipWhiteSpace( void )
{
 return 0;
}
//----------------------------------------------------------------------------//
bool DataStream::Lock( int _time_ms )
{
     return m_mutex -> Lock( _time_ms );
}
//----------------------------------------------------------------------------//
void DataStream::Unlock( void )
{
     m_mutex -> Unlock();
}
//----------------------------------------------------------------------------//
//----------------------------------------------------------------------------//

} // namespace zx
